home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Games / PC-SIG World of Games (CDRM1080710) (1993).iso / ENT / DISK0001.ZIP / WUMPUS.BAS < prev    next >
BASIC Source File  |  1982-02-07  |  10KB  |  373 lines

  1. 1000 PRINT TAB(10);"WUMPUS 2"
  2. 1010 PRINT " "
  3. 1020 REM - wumpus version 2
  4. 1030 DIM S(20,3)
  5. 1040 DIM L(6),M(6),P(5)
  6. 1050 PRINT "Instructions ?? (y,n);
  7. 1060 INPUT I$
  8. 1070 PRINT " "
  9. 1080 IF LEFT$(I$,1) <> "y" THEN 1110
  10. 1090 GOSUB 1640
  11. 1100 REM - choose and set up cave
  12. 1110 GOSUB 3680
  13. 1113 Q$=MID$(TIME$,7,2)
  14. 1114 Q1=CVI(Q$)
  15. 1115 RANDOMIZE(Q1)
  16. 1120 DEF FNA(X)=INT(20*RND)+1
  17. 1130 DEF FNB(X)=INT(3*RND)+1
  18. 1140 DEF FNC(X)=INT(4*RND)+1
  19. 1150 REM locate l array items
  20. 1160 REM 1-you, 2-wumpus, 3&4-pits, 5&6-bats
  21. 1170 FOR J=1 TO 6
  22. 1180 L(J)=FNA(0)
  23. 1190 M(J)=L(J)
  24. 1200 NEXT J
  25. 1210 REM - check for crossover (ie l(1)=l(2) etc)
  26. 1220 FOR J=1 TO 6
  27. 1230 FOR K=J TO 6
  28. 1240 IF J=K THEN 1260
  29. 1250 IF L(J)=L(K) THEN 1170
  30. 1260 NEXT K
  31. 1270 NEXT J
  32. 1280 REM - set # arrows
  33. 1290 A=5
  34. 1300 L=L(1)
  35. 1310 REM - run the game
  36. 1320 PRINT "Hunt the wumpus."
  37. 1330 REM-hazards warnings and location
  38. 1340 GOSUB 2410
  39. 1350 REM move or shoot
  40. 1360 GOSUB 2580
  41. 1370 ON O GOTO 1390,1430
  42. 1380 REM shoot
  43. 1390 GOSUB 2720
  44. 1400 IF F=0 THEN 1360
  45. 1410 GOTO 1450
  46. 1420 REM move
  47. 1430 GOSUB 3300
  48. 1440 IF F=0 THEN 1340
  49. 1450 IF F > 0 THEN 1500
  50. 1460 REM lose
  51. 1470 PRINT "HA HA HA - You LOOSE!!!"
  52. 1480 GOTO 1510
  53. 1490 REM win
  54. 1500 PRINT "HEE HEE HEE - The WUMPUS'LL GET YOU NEXT TIME!!!"
  55. 1510 FOR J=1 TO 6
  56. 1520 L(J)=M(J)
  57. 1530 NEXT J
  58. 1540 PRINT "Play again ?? (y/n)";
  59. 1550 INPUT I$
  60. 1560 PRINT " "
  61. 1570 PRINT " "
  62. 1580 IF LEFT$(I$,1) <> "y" THEN 4640
  63. 1590 PRINT "Same set-up ?? (y/n);
  64. 1600 INPUT I$
  65. 1610 PRINT " "
  66. 1620 IF LEFT$(I$,1) <> "y" THEN 1110
  67. 1630 GOTO 1290
  68. 1640 REM - instructions
  69. 1650 PRINT "Welcome to WUMPUS II"
  70. 1655 PRINT
  71. 1660 PRINT "This version has the same rules as"
  72. 1670 PRINT "'Hunt The WUMPUS'.  However, you"
  73. 1680 PRINT "now have a choice of caves to play"
  74. 1690 PRINT "in.  Some caves are easier than"
  75. 1700 PRINT "others.  All caves have 20 rooms"
  76. 1710 PRINT "and 3 tunnels leading from one room"
  77. 1720 PRINT "to other rooms."
  78. 1730 PRINT "The caves are:"
  79. 1740 PRINT " 0 - DODECAHEDRON -- The rooms of this"
  80. 1750 PRINT "     cave are on a 12-sided object,"
  81. 1760 PRINT "     each forming a pentagon.  The"
  82. 1770 PRINT "     rooms are at the corners of the"
  83. 1780 PRINT "     pentagons.  Each room having"
  84. 1790 PRINT "     tunnels that lead to 3 other rooms."
  85. 1800 PRINT " "
  86. 1810 PRINT " 1 - MOBIUS STRIP -- This cave is two"
  87. 1820 PRINT "     rooms wide and 10 rooms around"
  88. 1830 PRINT "     (like a belt).  You will notice"
  89. 1840 PRINT "     there is a half twist somewhere."
  90. 1850 PRINT " "
  91. 1860 PRINT "Press enter to continue";
  92. 1870 INPUT X$
  93. 1880 PRINT " "
  94. 1890 PRINT " 2 - STRING OF BEADS -- Five beads in"
  95. 1900 PRINT "     a circle.  Each bead is a diamond"
  96. 1910 PRINT "     with a vertical cross-bar. The"
  97. 1920 PRINT "     right & left corners lead to"
  98. 1930 PRINT "     neighbouring beads.  (This one is"
  99. 1940 PRINT "     difficult to play)."
  100. 1950 PRINT " "
  101. 1960 PRINT " 3 - HEX NETWORK -- Imagine a hex tile"
  102. 1970 PRINT "     floor.  Take a rectangle with 20"
  103. 1980 PRINT "     points (intersections) inside"
  104. 1990 PRINT "     (4X4).  Join right & left sides"
  105. 2000 PRINT "     to make a cylinder.  Then join"
  106. 2010 PRINT "     top & bottom to form a torus"
  107. 2020 PRINT "     (doughnut)."
  108. 2030 PRINT "     Have fun imagining this one!!"
  109. 2040 PRINT " "
  110. 2050 PRINT " Caves 1-3 are regular in a sense that"
  111. 2060 PRINT "each room goes to three other rooms &"
  112. 2070 PRINT "tunnels allow two-way traffic.  Here"
  113. 2080 PRINT "are some 'irregular' caves:"
  114. 2090 PRINT " "
  115. 2100 PRINT "Press enter to continue";
  116. 2110 INPUT X$
  117. 2120 PRINT " 4 - DENDRITE WITH DEGENERACIES --"
  118. 2130 PRINT "     Pull a plant from the ground."
  119. 2140 PRINT "     The roots & branches form a"
  120. 2150 PRINT "     DENDRITE - ie., there are no"
  121. 2160 PRINT "     looping paths.  Degeneracy means"
  122. 2170 PRINT "     a) some rooms connect to themselve"
  123. 2180 PRINT "     and b) some rooms have more than"
  124. 2190 PRINT "     one tunnel to the same other room"
  125. 2200 PRINT "     ie, 12 has two tunnels to 13."
  126. 2210 PRINT " "
  127. 2220 PRINT " 5 - ONE WAY LATTICE - Here all tunnels"
  128. 2230 PRINT "     go one way only.  To return, you"
  129. 2240 PRINT "     must go around the cave.  (About"
  130. 2250 PRINT "     5 moves)."
  131. 2260 PRINT " "
  132. 2270 PRINT " 6 - ENTER YOUR OWN CAVE !! -- The"
  133. 2280 PRINT "     computer will ask you the rooms"
  134. 2290 PRINT "     next to each room in the cave."
  135. 2300 PRINT "       For Example:"
  136. 2310 PRINT "     Room #1    ? 2,3,4   -- your reply"
  137. 2320 PRINT "     means room 1 has tunnels going to"
  138. 2330 PRINT "     rooms 2, 3, &4."
  139. 2340 PRINT " "
  140. 2350 PRINT "Press enter to continue";
  141. 2360 INPUT X$
  142. 2370 PRINT " "
  143. 2380 PRINT "HAPPY HUNTING !!"
  144. 2390 PRINT " "
  145. 2400 RETURN
  146. 2410 REM
  147. 2420 PRINT " "
  148. 2430 FOR J=2 TO 6
  149. 2440 FOR K=1 TO 3
  150. 2450 IF S(L(1),K) <> L(J) THEN 2520
  151. 2460 ON J-1 GOTO 2470,2490,2490,2510,2510
  152. 2470 PRINT "I smell a WUMPUS !!"
  153. 2480 GOTO 2520
  154. 2490 PRINT "I feel a DRAFT !!"
  155. 2500 GOTO 2520
  156. 2510 PRINT "BATS Nearby !!"
  157. 2520 NEXT K
  158. 2530 NEXT J
  159. 2540 PRINT "You are in room ";L(1)
  160. 2550 PRINT "Tunnels lead to "S(L,1);S(L,2);S(L,3)
  161. 2560 PRINT " "
  162. 2570 RETURN
  163. 2580 REM - choose option
  164. 2590 GOTO 2630
  165. 2600 PRINT "error    ";
  166. 2610 INPUT Z9
  167. 2620 PRINT " "
  168. 2630 PRINT "Shoot or move ";
  169. 2640 INPUT I$
  170. 2650 PRINT " "
  171. 2660 IF LEFT$(I$,1) <> "s" THEN 2690
  172. 2670 O=1
  173. 2680 RETURN
  174. 2690 IF LEFT$(I$,1) <> "m" THEN 2600
  175. 2700 O=2
  176. 2710 RETURN
  177. 2720 REM - arrow routine
  178. 2730 F=0
  179. 2740 REM - path of arrow
  180. 2750 GOTO 2790
  181. 2760 PRINT "error   ";
  182. 2770 INPUT Z9
  183. 2780 PRINT " "
  184. 2790 PRINT "No. of rooms ";
  185. 2800 INPUT J9
  186. 2810 PRINT " "
  187. 2820 IF J9 < 1 OR J9 > 5 OR INT(J9) <> ABS(J9) THEN 2760
  188. 2830 FOR K=1 TO J9
  189. 2840 PRINT "Room #";
  190. 2850 INPUT P(K)
  191. 2860 PRINT " "
  192. 2870 IF P(K) > 0 AND P(K) < 21 AND INT(P(K))=ABS(P(K)) THEN 2920
  193. 2880 PRINT "error  ";
  194. 2890 INPUT Z9
  195. 2900 PRINT " "
  196. 2910 GOTO 2840
  197. 2920 NEXT K
  198. 2930 PRINT " "
  199. 2940 REM - shoot arrow
  200. 2950 A=A-J9
  201. 2960 A9=L(1)
  202. 2970 FOR K=1 TO J9
  203. 2980 FOR K1=1 TO 3
  204. 2990 IF S(A9,K1)=P(K) THEN 3140
  205. 3000 NEXT K1
  206. 3010 REM - no tunnel for the arrow
  207. 3020 A9=S(A9,FNB(1))
  208. 3030 GOTO 3150
  209. 3040 NEXT K
  210. 3050 PRINT "Missed"
  211. 3060 REM - move wumpus
  212. 3070 GOSUB 3220
  213. 3080 REM - ammo check
  214. 3090 IF A > 0 THEN 3120
  215. 3100 PRINT "You have used ALL of your ARROWS"
  216. 3110 F=-1
  217. 3120 RETURN
  218. 3130 REM - see if arrow is at l(1) or l(2)
  219. 3140 A9=P(K)
  220. 3150 IF A9 <> L(2) THEN 3190
  221. 3160 PRINT "AHA! You got the WUMPUS! He was in room";L(2)
  222. 3170 F=1
  223. 3180 RETURN
  224. 3190 IF A9 <> L(1) THEN 3040
  225. 3200 PRINT "OUCH! Arrow got YOU!"
  226. 3210 GOTO 3110
  227. 3220 REM - move wumpus routine
  228. 3230 K=FNC(0)
  229. 3240 IF K=4 THEN 3290
  230. 3250 L(2)=S(L(2),K)
  231. 3260 IF L(2) <> L THEN 3290
  232. 3270 PRINT "TSK TSK TSK - WUMPUS Got YOU!!"
  233. 3280 F=-1
  234. 3290 RETURN
  235. 3300 REM - move routine
  236. 3310 F=0
  237. 3320 GOTO 3360
  238. 3330 PRINT "Error   ";
  239. 3340 INPUT Z9
  240. 3350 PRINT " "
  241. 3360 PRINT "Where to ";
  242. 3370 INPUT L
  243. 3380 PRINT " "
  244. 3390 IF L < 1 OR L > 20 OR ABS(L) <> INT(L) THEN 3330
  245. 3400 FOR K=1 TO 3
  246. 3410 REM - check if legal move
  247. 3420 IF S(L(1),K)=L THEN 3490
  248. 3430 NEXT K
  249. 3440 IF L=L(1) THEN 3490
  250. 3450 PRINT "Not possible - ";
  251. 3460 INPUT Z9
  252. 3470 GOTO 3360
  253. 3480 REM - check for hazards
  254. 3490 L(1)=L
  255. 3500 REM - wumpus
  256. 3510 IF L <> L(2) THEN 3570
  257. 3520 PRINT "...OOPS! BUMPED A WUMPUS !"
  258. 3530 REM - move a wumpus
  259. 3540 GOSUB 3230
  260. 3550 IF F=0 THEN 3570
  261. 3560 REM - pit
  262. 3570 IF L <> L(3) AND L <> L(4) THEN 3620
  263. 3580 PRINT "YYYIIIEEEE . . . FELL IN A PIT !"
  264. 3590 F=-1
  265. 3600 RETURN
  266. 3610 REM - bats
  267. 3620 IF L <> L(5) AND L <> L(6) THEN 3670
  268. 3630 PRINT "ZAP--SUPER BAT SNATCH!"
  269. 3640 PRINT "ELSEWHERESVILLE FOR YOU!"
  270. 3650 L=FNA(1)
  271. 3660 GOTO 3490
  272. 3670 RETURN
  273. 3680 REM - select cave
  274. 3690 GOTO 3730
  275. 3700 PRINT "Error   ";
  276. 3710 INPUT Z9
  277. 3720 PRINT ""
  278. 3730 PRINT "cave #(0-6) ";
  279. 3740 RESTORE
  280. 3750 INPUT N
  281. 3760 PRINT
  282. 3770 IF N<0 OR N>6 OR INT(N) <> ABS(N) THEN 3700
  283. 3780 ON N+1 GOSUB 3930,3870,3990,4110,4230,4350,4460
  284. 3790 RETURN
  285. 3800 REM - dodecahedron
  286. 3810 DATA 2,5,8,1,3,10,2,4,12,3,5,14,1,4,6
  287. 3820 DATA 5,7,15,6,8,17,1,7,9,8,10,18,2,9,11
  288. 3830 DATA 10,12,19,3,11,13,12,14,20,4,13,15,6,14,16
  289. 3840 DATA 15,17,20,7,16,18,9,17,19,11,18,20,13,16,19
  290. 3850 GOSUB 4570
  291. 3860 RETURN
  292. 3870 REM - mobius strip
  293. 3880 FOR B1=1 TO 1
  294. 3890 FOR B2=1 TO 60
  295. 3900 READ B0
  296. 3910 NEXT B2
  297. 3920 NEXT B1
  298. 3930 DATA 20,2,3,19,1,4,1,4,5,2,3,6,3,6,7
  299. 3940 DATA 4,5,8,5,8,9,6,7,10,7,10,11,8,9,12
  300. 3950 DATA 9,12,13,10,11,14,11,14,15,12,13,16,12,16,17
  301. 3960 DATA 14,15,18,15,18,19,16,17,20,2,17,20,1,18,19
  302. 3970 GOSUB 4570
  303. 3980 RETURN
  304. 3990 REM - string of beads
  305. 4000 FOR B1=1 TO 2
  306. 4010 FOR B2=1 TO 60
  307. 4020 READ B0
  308. 4030 NEXT B2
  309. 4040 NEXT B1
  310. 4050 DATA 2,3,20,1,3,4,1,2,4,2,3,5,4,6,7
  311. 4060 DATA 5,7,8,5,6,8,6,7,9,8,10,11,9,11,12
  312. 4070 DATA 9,10,12,10,11,13,12,14,15,13,15,16,13,14,16
  313. 4080 DATA 14,15,17,16,18,19,17,19,20,17,18,20,1,18,19
  314. 4090 GOSUB 4570
  315. 4100 RETURN
  316. 4110 REM - hex nut on torus
  317. 4120 FOR B1=1 TO 3
  318. 4130 FOR B2=1 TO 60
  319. 4140 READ B0
  320. 4150 NEXT B2
  321. 4160 NEXT B1
  322. 4170 DATA 6,10,16,6,7,17,7,8,18,8,9,19,9,10,20
  323. 4180 DATA 1,2,15,2,3,11,3,4,12,4,5,13,5,6,14
  324. 4190 DATA 7,16,20,8,16,17,9,17,18,10,18,19,6,19,20
  325. 4200 DATA 1,11,12,2,12,13,3,13,14,4,14,15,5,11,15
  326. 4210 GOSUB 4570
  327. 4220 RETURN
  328. 4230 REM - dendrite w/ degeneracies
  329. 4240 FOR B1=1 TO 4
  330. 4250 FOR B2=1 TO 60
  331. 4260 READ B0
  332. 4270 NEXT B2
  333. 4280 NEXT B1
  334. 4290 DATA 1,1,5,2,2,5,3,3,6,4,4,6,1,2,7
  335. 4300 DATA 3,4,7,5,6,10,8,9,9,8,8,10,7,9,11
  336. 4310 DATA 10,13,14,12,13,13,11,12,12,11,15,16,14,17,18
  337. 4320 DATA 14,19,20,15,17,17,15,18,18,16,19,19,16,20,20
  338. 4330 GOSUB 4570
  339. 4340 RETURN
  340. 4350 REM - one way lattice
  341. 4360 FOR B1=1 TO 53057! FOR B2=1 TO 60
  342. 4370 READ B0
  343. 4380 NEXT B2
  344. 4390 NEXT B1
  345. 4400 DATA 5,4,8,1,5,6,2,6,7,3,7,8,8,9,12
  346. 4410 DATA 5,9,10,6,10,11,7,11,12,12,13,16,9,13,14
  347. 4420 DATA 10,14,15,11,15,16,16,17,20,13,17,18,14,18,19
  348. 4430 DATA 15,19,20,1,4,20,1,2,17,2,3,18,3,4,19
  349. 4440 GOSUB 4570
  350. 4450 RETURN
  351. 4460 REM - input your own cave
  352. 4470 FOR J=1 TO 20
  353. 4480 PRINT "room #";J;
  354. 4490 INPUT S(J,1),S(J,2),S(J,3)
  355. 4500 FOR K=1 TO 3
  356. 4510 IF S(J,K) > 0 AND S(J,K) < 21 AND ABS(S(J,K))=INT(S(J,K)) THEN 4540
  357. 4520 PRINT "***** ERROR !!!!!"
  358. 4530 GOTO 4480
  359. 4540 NEXT K
  360. 4550 NEXT J
  361. 4560 RETURN
  362. 4570 REM - input cave
  363. 4580 FOR J=1 TO 20
  364. 4590 FOR K=1 TO 3
  365. 4600 READ S(J,K)
  366. 4610 NEXT K
  367. 4620 NEXT J
  368. 4630 RETURN
  369. 4640 END
  370. 70 REM - input cave
  371. 4580 FOR J=1 TO 20
  372. 4590 FOR K=1 TO 3
  373.